<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>编辑新闻</title>
  <!-- Bootstrap core CSS -->
  <link href="/css/bootstrap.min.css" rel="stylesheet">
  <!-- Custom styles for this template -->
  <link href="/css/dashboard.css" rel="stylesheet">
</head>

<body>
<!--顶部菜单 -->
<div th:replace="~{topleft::topnav}"></div>
<div class="container-fluid">
  <div class="row">
    <!--左菜单 -->
    <div th:replace="~{topleft::#sidebarMenu(lurl='leftnews')}"></div>
    <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
      <div class="form-container">
        <h2>编辑新闻</h2>
        <form th:action="@{/news/update}" method="post">
          <input type="hidden" name="id" th:value="${news.id}" />
          <div class="form-group">
            <label for="title">标题</label>
            <input type="text" class="form-control" id="title" name="title" th:value="${news.title}" placeholder="输入标题">
          </div>
          <div class="form-group">
            <label for="author">作者</label>
            <input type="text" class="form-control" id="author" name="author" th:value="${news.author}" placeholder="作者名">
          </div>
          <div class="form-group">
            <label for="content">内容</label>
            <textarea class="form-control" id="content" name="content" rows="5" th:text="${news.content}"></textarea>
          </div>
          <button type="submit" class="btn btn-primary">更新</button>
        </form>
      </div>
    </main>
  </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>

<!-- Icons -->
<script type="text/javascript" src="/static/js/feather.min.js"></script>
<script>
  feather.replace();
</script>
</body>

</html>
